package org.aplikator.client.descriptor;

import org.aplikator.client.widgets.FormWidget;
import org.aplikator.client.widgets.RepeatedFormWidget;
import com.google.gwt.user.client.ui.Widget;

@SuppressWarnings("serial")
public class RepeatedFormDTO implements WidgetDTO {

    private PropertyDTO<Integer> property;
    private ViewDTO view;

    @SuppressWarnings("unused")
    private RepeatedFormDTO() {
    }

    public RepeatedFormDTO(PropertyDTO<Integer> property, ViewDTO view) {
        this.property = property;
        this.view = view;
    }

    public Widget getWidget(FormWidget form) {
        RepeatedFormWidget repeatedForm = new RepeatedFormWidget(view, property, form);
        form.registerNestedCollection(repeatedForm);
        return repeatedForm;

    }

}
